This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % This Matlab script calls the "mini_epi.m" which is a Brainstorm pipeline | |
| % Call is done unsing Matlab | |
| % | |
| % See also the equivalent Python script: "call_mini_epi_m.py" | |
| % | |
| % More details about "mini_epi.m" in the comments of that function | |
| % Full paths | |
| Brainstorm3Dir = '/home/rcassani/Desktop/brainstorm3'; | |
| TutorialDir = '/home/rcassani/Desktop'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Create figure with mouse up callback | |
| fig = figure('WindowButtonUpFcn', @FigureMouseUpCallback); | |
| % Create popup menu on click place on right click | |
| function FigureMouseUpCallback(hFig, ev) | |
| import java.awt.MouseInfo.getPointerInfo | |
| import javax.swing.JPopupMenu | |
| import javax.swing.JMenuItem | |
| if strcmpi(get(hFig, 'SelectionType'), 'alt') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % 1. Load the contents of the coherence `.mat` file | |
| TfMat = in_bst_timefreq('Subject01/Simulation/timefreq_connectn_cohere_260105_1544.mat'); | |
| % 2. Get the coherence spectra for each pair of signals: [nSignalA*nSignalB, nTime, nFreq] | |
| R_3d = process_compress_sym('Expand', TfMat.TF, length(TfMat.RowNames)); | |
| [~, nTime, nFreq] = size(R_3d); | |
| % Handle the case of one time sample | |
| if nTime == 1 && length(TfMat.Time) == 2 | |
| TfMat.Time = mean(TfMat.Time); | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Script to add locations to electrodes in Axion CYTOVIEW MEA 24 for Brainstorm | |
| % | |
| % Simone Doad, 2025 | |
| % Raymundo Cassani, 2025 | |
| % | |
| % MEA channel names are composed of 4 characters that give the location information: | |
| % 1st char: WellRow = 1st index in 4D array, 'A', 'B',... = 1, 2,... | |
| % 2nd char: WellColumn = 2nd index in 4D array, '1', '2',... = 1, 2,... | |
| % 3rd char: ElectrodeColumn = 3rd index in 4D array, '1', '2',... = 1, 2,... | |
| % 4th char: ElectrodeRow = 4th index in 4D array, '1', '2',... = 1, 2,... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Brainstorm script | |
| % Cast a TimeFrequency file to a Data recording | |
| % TimeFreq file MUST have size [nChannels, nSamples, nFreqs] with nFreqs = 1 | |
| % This size can be obtained: | |
| % - From a TimeFreq file with the process Extract > Extract values | |
| % - Computing the TimeFreq file for only one frequency band | |
| % Input TimeFreq file | |
| timeFreqFile = 'Subject01/S01_AEF_20131218_01_600Hz_notch/timefreq_psd_231117_1140.mat'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % ICA variance explained | |
| %% Signals | |
| % Sound | |
| load chirp.mat | |
| nSamples = length(y); | |
| y = y'; | |
| % Create 10 signals | |
| y_noise = 0.4 * randn([9, nSamples]); | |
| F = [y; y_noise + repmat(y, 9, 1)]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Brainstorm script to obtain the mean value for a Volume (PET or Neuromap) | |
| % for each of the parcellations in an anatomical parcellation (e.g. Desikan-Killiany) | |
| %% PARAMETERS | |
| % FileName for the Volume to use (Subject/VolFile) | |
| volFileName = 'sub-MTL0002/subjectimage_sub-MTL0002_ses-01_trc-18Fflortaucipir_pet_spm_reslice_volpet.mat'; | |
| % Anatomical parcellation | |
| volAtlasName = 'Desikan-Killiany'; | |
| %% COMPUTATION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% Understanding FOOOF parameters in Brainstorm, using one channel as example | |
| % This is based on the files from the FOOOF tutorial | |
| % https://neuroimage.usc.edu/brainstorm/Tutorials/Fooof | |
| % | |
| % Raymundo Cassani, 2025 | |
| %% FIND PSD AND FOOOF FILES | |
| % Process: Select timefreq files in: Subject01/@rawS01_AEF_20131218_01_600Hz_notch | |
| sFiles = bst_process('CallProcess', 'process_select_files_timefreq', [], [], ... | |
| 'subjectname', 'Subject01', ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% SQLite queries to Brainstorm database can be faster by using JOIN on tables | |
| % The existence of Raw and NoRaw Subjects complicates the JOIN as for | |
| % NoRaw subjects it is needed to copy some fields from the DefaultAnatomy | |
| % and this is done with the function COALESCE | |
| % However, using COALESCE, we must write down all the fields, as '*' is not supported | |
| % | |
| % See examples below | |
| %% Non-raw Subject | |
| % Keep only SQLite fields |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Script for Brainstorm | |
| % For the provided anatomies ('testAnatomies'), find their already registered EEG caps | |
| % and adjust the location of the EEG sensor if request (isReplaceLocs) and if | |
| % one or more EEG sensors were moved more than ('distThreshold') millimeters | |
| % | |
| % Raymundo Cassani, 2024 | |
| %% ===== PARAMETERS ===== | |
| testAnatomies = {'Colin27_2016', 'ICBM152_2023b'}; | |
| isReplaceLocs = 1; |
NewerOlder