-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from cpp-lln-lab/remi-roi_based_glm
[ENH] update roi based glm
- Loading branch information
Showing
70 changed files
with
1,740 additions
and
354 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Submodule CPP_ROI
updated
4 files
+1 −1 | .pre-commit-config.yaml | |
+0 −191 | demos/roi/step_7_get_ROI_PSC.m | |
+0 −241 | demos/roi/step_8_plot_PSC.m | |
+1 −1 | miss_hit.cfg |
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,82 @@ | ||
function figureFile = plotRoiTimeCourse(varargin) | ||
% | ||
% Plots the peristimulus histogram from a ROI based GLM | ||
% | ||
% USAGE:: | ||
% | ||
% plotRoiTimeCourse(tsvFile) | ||
% | ||
% :param tsvFile: obligatory argument. | ||
% :type tsvFile: path | ||
% | ||
% See also: bidsRoiBasedGLM(varargin) | ||
% | ||
% (C) Copyright 2022 CPP_SPM developers | ||
|
||
p = inputParser; | ||
|
||
isFile = @(x) exist(x, 'file') == 2; | ||
|
||
addRequired(p, 'tsvFile', isFile); | ||
addOptional(p, 'verbose', true, @islogical); | ||
|
||
parse(p, varargin{:}); | ||
|
||
visible = 'off'; | ||
if p.Results.verbose | ||
visible = 'on'; | ||
end | ||
|
||
tsvFile = p.Results.tsvFile; | ||
timeCourse = bids.util.tsvread(tsvFile); | ||
conditionNames = fieldnames(timeCourse); | ||
|
||
for i = 1:numel(conditionNames) | ||
tmp(:, i) = timeCourse.(conditionNames{i}); | ||
end | ||
timeCourse = tmp; | ||
|
||
jsonFile = bids.internal.file_utils(tsvFile, 'ext', '.json'); | ||
content = bids.util.jsondecode(jsonFile); | ||
|
||
secs = [0:size(timeCourse, 1) - 1] * content.SamplingFrequency; | ||
|
||
bf = bids.File(tsvFile); | ||
|
||
if isGithubCi() | ||
return | ||
end | ||
|
||
figName = ['ROI: ' bf.entities.label]; | ||
if isfield(bf.entities, 'hemi') | ||
figName = [figName ' - ' bf.entities.hemi]; | ||
end | ||
spm_figure('Create', 'Tag', figName, visible); | ||
|
||
hold on; | ||
|
||
plot(secs, timeCourse, 'linewidth', 2); | ||
plot([0 secs(end)], [0 0], '--k'); | ||
|
||
title(['Time courses for ' figName], ... | ||
'Interpreter', 'none'); | ||
|
||
xlabel('Seconds'); | ||
ylabel('Percent signal change'); | ||
|
||
legend_content = regexprep(conditionNames, '_', ' '); | ||
|
||
axis tight; | ||
|
||
for i = 1:numel(conditionNames) | ||
legend_content{i} = sprintf('%s ; max(PSC)= %0.2f', ... | ||
legend_content{i}, ... | ||
content.(conditionNames{i}).percentSignalChange.max); | ||
end | ||
|
||
legend(legend_content); | ||
|
||
figureFile = bids.internal.file_utils(tsvFile, 'ext', '.png'); | ||
print(gcf, figureFile, '-dpng'); | ||
|
||
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
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
Oops, something went wrong.