Skip to content

Conversation

@Remi-Gau
Copy link
Contributor

@Remi-Gau Remi-Gau commented Apr 2, 2021

fixes #323

When concatenating betamaps.

Ensures that there is only 1 image per "contrast".

Creates a tsv that lists the content of the 4D image.

TSV is in the subject level GLM folder where the beta map came from.

TSV file is named sub-subLabel_task-taskName_space-space_labelfold.tsv.

An example of the content.

folds labels
1 Correct_Task*bf(1)
2 Correct_Task*bf(1)
1 Incorrect_Task*bf(1)
2 Incorrect_Task*bf(1)

folds and labels are used as they are more commonly used in MVPA analysis than runs or trial type (condition) : hope this is not too confusing.

it can be loaded with spm_load.

content = spm_load('sub-02_task-linebisection_space-MNI_labelfold.tsv')

content = 

  struct with fields:

     folds: [4×1 double]
    labels: {4×1 cell}

@codecov
Copy link

codecov bot commented Apr 2, 2021

Codecov Report

Merging #338 (0895c96) into dev (e727bd9) will decrease coverage by 0.47%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #338      +/-   ##
==========================================
- Coverage   64.39%   63.91%   -0.48%     
==========================================
  Files         110      110              
  Lines        1733     1746      +13     
==========================================
  Hits         1116     1116              
- Misses        617      630      +13     
Impacted Files Coverage Δ
src/workflows/bidsConcatBetaTmaps.m 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e727bd9...0895c96. Read the comment docs.

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Apr 2, 2021

FYI in Correct_Task*bf(1) means that this is the name of the regressor that resulted from the convolution of the onsets vector of the condition Correct_Task with the first basis function bf(1) (in this case the canonical component of the hemodynamic response function used by SPM).

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Apr 2, 2021

No rush to review. I was just in the food to get this one out of m way.

@Remi-Gau Remi-Gau merged commit 5dbd585 into cpp-lln-lab:dev Apr 7, 2021
@Remi-Gau Remi-Gau deleted the remi-save_info_concatenation branch April 7, 2021 16:12
@CerenB
Copy link
Collaborator

CerenB commented Apr 8, 2021

folds and labels are used as they are more commonly used in MVPA analysis than runs or trial type (condition) : hope this is not too confusing.

very nice, I finally ran with the demo. folds is not used in cosmo-mvpa, and it could be slightly confusing. Can we add an explanation into the beginning of script? To say it could be "runs" or "repetitions" , or ...something else?
e.g. folds represent the runs/repetitions of condition, and labels represent trial type (condition).

% Creates a tsv that lists the content of the 4D image.
% This TSV is in the subject level GLM folder where the beta map came from.
% This TSV file is named ``sub-subLabel_task-taskName_space-space_labelfold.tsv``.
%
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

% in tsv file, folds represent the runs/repetitions of condition, and labels represent trial type (condition).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was not sure what terms to use because people in different fields use different words to refer to the same thing...

Should we stick with BIDS nomenclature: run and trial_type ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like BIDS labelling. and it is true that folds are used in some other toolboxes... only thing about the run is, it might be confusing when one has 4D-maps with repetitions (run 1 repetition1, run1 repetition2, ...). No?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha yes... you are right...

but actually, it could be useful to have both run and repetition, no?

the most "verbose" way of doing this is taking the whole name of the regressor for each image from SPM.mat

this should contain all the info you need: and it is then up to the user to parse this string.

so having the run info AND the regressor_name? there will be a bit of information redundancy because the run number is in the regressor name but...meh...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the current form, if i am not mistaken, we needed to change the trial type (in _events.tsv file) for GLM to have separate repetitions modelled as separate regressors (betas). so technically it would work like this:

repetition runs trial_type
1 1 Correct_Task*bf(1)_rep1
2 1 Correct_Task*bf(1)_rep2
1 2 Correct_Task*bf(1)_rep1
2 2 Correct_Task*bf(1)_rep2
1 1 Incorrect_Task*bf(1)_rep1
2 1 Incorrect_Task*bf(1)_rep2
1 2 Incorrect_Task*bf(1)_rep1
2 2 Incorrect_Task*bf(1)_rep2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sort of (I think that SPM always appends the BF at the end)

repetition runs trial_type
1 1 Correct_Task_rep1*bf(1)
2 1 Correct_Task_rep2*bf(1)
1 2 Correct_Task_rep1*bf(1)
2 2 Correct_Task_rep2*bf(1)
...

But the issue that not everyone will have repetitions, but everyone will have runs and "trial_type".

Also the names of the regressors are longer:

'Sn(1) listening*bf(1)'

Where Sn(X) is the number of the 'session' in SPM lingo (more or less a 'run' in the BIDS world... why use the same terms, huh?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants