Skip to content

Commit

Permalink
get results compare sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Jul 9, 2024
1 parent 71e5a58 commit aa4e54f
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,19 @@
"X": [
1
],
"Type": "glm"
"Type": "glm",
"Software": {
"bidspm": {
"Results": [
{
"name": [
"Correct_Task",
"TaskResponded_gt_CtrlResponded"
]
}
]
}
}
},
"DummyContrasts": {
"Test": "t"
Expand All @@ -133,7 +145,18 @@
"session",
1
],
"Type": "glm"
"Type": "glm",
"Software": {
"bidspm": {
"Results": [
{
"name": [
"test_gt_retest-TaskResponded_gt_CtrlResponded"
]
}
]
}
}
},
"Contrasts": [
{
Expand Down
10 changes: 10 additions & 0 deletions docs/source/stats/bids_stats_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,17 @@ Subject level contrast averaging beta across runs

##### cross-session comparisons

```{literalinclude} ./examples/model-crossSession_smdl.json
:language: json
```

```{figure} ./images/gui_contrast_cross_session.png
---
name: contrast_subject
align: center
---
Subject level contrast averaging beta across runs
```

## Dataset level

Expand Down
135 changes: 135 additions & 0 deletions docs/source/stats/examples/model-crossSession_smdl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"Nodes": [
{
"Level": "Run",
"Name": "run",
"GroupBy": [
"run",
"session",
"subject"
],
"Model": {
"X": [
"trial_type.Correct_Task",
"trial_type.Incorrect_Task",
"trial_type.No_Response_Control",
"trial_type.No_Response_Task",
"trial_type.Response_Control",
"trans_?",
"rot_?",
"1"
],
"Type": "glm",
"HRF": {
"Variables": [
"trial_type.Correct_Task",
"trial_type.Incorrect_Task",
"trial_type.No_Response_Control",
"trial_type.No_Response_Task",
"trial_type.Response_Control"
],
"Model": "spm"
}
},
"DummyContrasts": {
"Test": "t",
"Contrasts": [
"trial_type.Correct_Task",
"trial_type.Incorrect_Task",
"trial_type.No_Response_Control",
"trial_type.No_Response_Task",
"trial_type.Response_Control"
]
},
"Contrasts": [
{
"Name": "TaskResponded_gt_CtrlResponded",
"ConditionList": [
"trial_type.Correct_Task",
"trial_type.Incorrect_Task",
"trial_type.Response_Control"
],
"Weights": [
0.5,
0.5,
-1
],
"Test": "t"
}
]
},
{
"Level": "Session",
"Name": "session",
"GroupBy": [
"session",
"subject",
"contrast"
],
"Model": {
"X": [
1
],
"Type": "glm"
},
"DummyContrasts": {
"Test": "t"
}
},
{
"Level": "Subject",
"Name": "compare_sessions",
"GroupBy": [
"subject",
"contrast"
],
"Model": {
"X": [
"session",
1
],
"Type": "glm",
"Software": {
"bidspm": {
"Results": [
{
"name": [
"test_gt_retest-TaskResponded_gt_CtrlResponded"
]
}
]
}
}
},
"Contrasts": [
{
"Name": "test_gt_retest",
"ConditionList": [
"test",
"retest"
],
"Weights": [
1,
-1
],
"Test": "t"
}
]
}
],
"Edges": [
{
"Source": "run",
"Destination": "session",
"Filter": {
"contrast": [
"TaskResponded_gt_CtrlResponded"
]
}
},
{
"Source": "session",
"Destination": "compare_sessions"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions src/workflows/stats/bidsResults.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@
if ~isfield(opt, 'results') || isempty(opt.results) || ...
strcmp(opt.results(1).name{1}, '')
id = 'noResultsAsked';
logger('WARNING', msg, 'id', id, 'filename', mfilename());
logger('WARNING', msg, ...
'id', id, ...
'filename', mfilename(), ...
'options', opt);
status = false;
end

Expand All @@ -313,7 +316,10 @@

if isempty(listNodeNames) || isempty(listNodeLevels)
id = 'noResultsAsked';
logger('WARNING', msg, 'id', id, 'filename', mfilename());
logger('WARNING', msg, ...
'id', id, ...
'filename', mfilename(), ...
'options', opt);
status = false;
return
end
Expand Down

0 comments on commit aa4e54f

Please sign in to comment.