-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor bug fixes without impact to results, added groupby
applyCARLARealCCEPs.m - loading mef from absolute path (using fullfile(pwd, dataPath)) because of known crash issue with readMef3 - annotPath set to correctly load from derivatives - now annots are cleared before loading next subject, and if no annots variable exists, rmBadTrialsAnnots is not called. This affects only subject 4, and did not affect results after fixing, because the corresponding trial annots previously preserved from subject 3 were all n/a. applyCARLARealCCEPsLoop - mef path set to be absolute - annotPath correctly points to derivatives - clear annots added before loading annots Added missing function groupby.m Minor comment updates to main
- Loading branch information
1 parent
e7750ca
commit 58cc651
Showing
4 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
%% Creates a 2-column cell array where the first column indicates unique occurreences in the input, and second col tracks indices of each occurrence | ||
% Modeled after Python groupby function | ||
% | ||
% 2024/02/14 | ||
% | ||
% If this code is used in a publication, please cite the manuscript: | ||
% "CARLA: Adjusted common average referencing for cortico-cortical evoked potential data" | ||
% by H Huang, G Ojeda Valencia, NM Gregg, GM Osman, MN Montoya, | ||
% GA Worrell, KJ Miller, and D Hermes. | ||
% | ||
% CARLA manuscript package. | ||
% Copyright (C) 2023 Harvey Huang | ||
% | ||
% This program is free software: you can 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 <https://www.gnu.org/licenses/>. | ||
% | ||
function groups = groupby(strs) | ||
|
||
gs = cellfun(@(x) find(strcmp(x, strs)), unique(strs), 'UniformOutput', false); | ||
groups = [unique(strs), gs]; | ||
|
||
end |
This file contains 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