-
Notifications
You must be signed in to change notification settings - Fork 15
[ENH] add roi based GLM using mars bar #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6b5cac3
set up roi based GLMs
Remi-Gau 9bf5906
add mars bar roi based GLM estimation
Remi-Gau 2c88cfd
fit events and compute percent signal change
Remi-Gau 382b8b7
refactor MoAE to allow running with octave
Remi-Gau b599754
update tests
Remi-Gau 0eef7e1
fix test
Remi-Gau 0c1ef80
update tests
Remi-Gau c57312c
update face rep demo
Remi-Gau bce592c
reset demos
Remi-Gau d3f0a1b
add errors in FFX and roi based GLMs to prevent running them with the…
Remi-Gau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| % (C) Copyright 2021 Remi Gau | ||
|
|
||
| function dowload_MoAE_ds(downloadData) | ||
|
|
||
| if downloadData | ||
|
|
||
| % URL of the data set to download | ||
| URL = 'http://www.fil.ion.ucl.ac.uk/spm/download/data/MoAEpilot/MoAEpilot.bids.zip'; | ||
|
|
||
| working_directory = fileparts(mfilename('fullpath')); | ||
|
|
||
| % clean previous runs | ||
| if exist(fullfile(working_directory, 'inputs'), 'dir') | ||
| rmdir(fullfile(working_directory, 'inputs'), 's'); | ||
| end | ||
|
|
||
| spm_mkdir(fullfile(working_directory, 'inputs')); | ||
|
|
||
| %% Get data | ||
| fprintf('%-10s:', 'Downloading dataset...'); | ||
| urlwrite(URL, 'MoAEpilot.zip'); | ||
| fprintf(1, ' Done\n\n'); | ||
|
|
||
| fprintf('%-10s:', 'Unzipping dataset...'); | ||
| unzip('MoAEpilot.zip'); | ||
| movefile('MoAEpilot', fullfile(working_directory, 'inputs', 'raw')); | ||
| fprintf(1, ' Done\n\n'); | ||
|
|
||
| end | ||
|
|
||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| % (C) Copyright 2021 Remi Gau | ||
|
|
||
| function [anat_normalized_file, anatRange] = return_normalized_anat_file(opt, subLabel) | ||
|
|
||
| [BIDS, opt] = getData(opt); | ||
| [~, anatDataDir] = getAnatFilename(BIDS, subLabel, opt); | ||
| anat_normalized_file = spm_select('FPList', ... | ||
| anatDataDir, ... | ||
| '^wm.*skullstripped.nii$'); | ||
|
|
||
| hdr = spm_vol(anat_normalized_file); | ||
| vol = spm_read_vols(hdr); | ||
|
|
||
| anatRange = [min(vol(:)) max(vol(:))]; | ||
|
|
||
| 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
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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| clear; | ||
| clc; | ||
|
|
||
| downloadData = false; | ||
| downloadData = true; | ||
|
|
||
| run ../../initCppSpm.m; | ||
|
|
||
|
|
||
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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,10 @@ | |
| opt.roi.name = {'V1v', 'V1d'}; | ||
| opt.roi.space = {'MNI', 'individual'}; | ||
|
|
||
| opt.dir.stats = fullfile(opt.dataDir, '..', 'derivatives', 'cpp_spm-stats'); | ||
|
|
||
| bidsCreateROI(opt); | ||
|
|
||
| opt.glm.roibased.do = true; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if this option is set to false, would it do the whole brain analysis with different resolution spatial preprocessing? |
||
|
|
||
| bidsRoiBasedGLM(opt); | ||
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
Submodule CPP_ROI
updated
12 files
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 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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ | |
| end | ||
|
|
||
| rfxDir = fullfile( ... | ||
| opt.derivativesDir, ... | ||
| opt.dir.stats, ... | ||
| 'group', ... | ||
| glmDirName); | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is only for this function to create names (in order to do so, we need to create different model.json files) for different resolution? so that spatial preprocssing folders would be different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is only to create a different GLM folder name.
This is a bit "ugly" because everything in those json is the same: but I was trying to find a way to create different folder names that would not involve adding another option to the pile and would instead reuse something we already have to create GLM folder names.
Does that make sense?
Another option could have been to have a different
cpp_spm-statsfolder for each resolution but then all the stats would not be centralized.I think there is only so much data curation that can be automatized.