Skip to content

Instantly share code, notes, and snippets.

View neuromechanist's full-sized avatar
:octocat:
Commit and be happy

Seyed (Yahya) Shirazi neuromechanist

:octocat:
Commit and be happy
View GitHub Profile
@neuromechanist
neuromechanist / compare_twoProfiles.m
Created September 19, 2023 16:40
multiple waveform comparison in Matlab
function [fig, bts] = compare_twoProfiles(powerProfile, trialTypes, clusterIDs, signalIDs, typeOfComp, addShading, ...
grp_warpto, alltimes, clustNames, maxRow, phases)
for t = trialTypes, for i = clusterIDs %#ok<ALIGN>
if typeOfComp == "paired_test" || typeOfComp == "both"
if length(signalIDs) ~= 2, error("paired test need only a pair of signals"); end
comparison = {transpose(powerProfile(i).(t)(signalIDs(1)).individual_sum),...
transpose(powerProfile(i).(t)(signalIDs(2)).individual_sum)};
[~,~,bts.pVal(i).(t)] = statcond(comparison,'method','bootstrap','naccu',1000,'verbose','off');
bts.pVal(i).(t) = mcorrect(bts.pVal(i).(t),'fdr');
@neuromechanist
neuromechanist / plot_clustDipole.m
Created July 7, 2023 21:40
a blueprint for plotting cluster dipoles and topomaps
% The following scrips should help you plot cortical clusters that are already avaiable in a STUDY file.
% You need to have identified the cluster numbers and their names, from the Brodmann areas.
% (c) Seyed Yahya Shirazi, 07/2023, SCCN, INC, UCSD
%% load the study
study_path = "path_to_study/";
study_file = "file_name.study";
save_path = "path_to_dir_to_save_figures/";
eeglab; close;
@neuromechanist
neuromechanist / import_intan_rhd_to_eeglab.m
Last active April 16, 2023 22:19
Import Intan RHD2000 file and save as EEGLAB .set file
function import_intan_rhd_to_eeglab(filename, output_filename)
% import_intan_rhd_to_eeglab Import Intan RHD2000 file and save as EEGLAB .set file
%
% import_intan_rhd_to_eeglab(filename, output_filename) imports an Intan RHD2000
% file and saves it as an EEGLAB .set file. Requires the read_Intan_RHD2000_file
% function and EEGLAB toolbox.
%
% INPUTS:
% filename - String, path to the RHD2000 file containing ECoG data
% output_filename - String, path to save the converted EEGLAB .set file