TDT - Representational Similarity Analysis (RSA)

Hello Everyone,

I am new to RSA (and fMRI) and I am using The Decoding Toolbox (TDT). I am first running analysis on a unique subject to explore the TDT.

I have two (simple) questions:

(1) How do I average condition across run? I have 4 runs with 13 conditions but at the end I get a 52x52 matrix, while I would like a 13x13. I already tried: cfg.results.output = ‘other_average’ and cfg.results.output = ‘other’, with the same result. Do I have to average the beta values prior to the TDT?

(2) I get the outputs as 41376 matrix of 52x52. I would like to know if it is possible to use matlab and/or TDT to understand which voxels corresponds to each matrix. And/or if we have to use SPM (or other software) to analyse the results.

Here is how I am using the TDT:
I did the pre-processing and got the beta values.

cfg = decoding_defaults;
cfg.results.overwrite = 1;
cfg.analysis = ‘searchlight’;
cfg.results.dir = …directory
beta_loc = …directory

labelname1 = ‘NAbstractEmo’;
labelname2 = ‘NAbstractInternal’;
labelname3 = ‘NFace’;
labelname4 = ‘NHand’;
labelname5 = ‘NAnimal’;
labelname6 = ‘NFiller’;
labelname7 = ‘VAbstractEmo’;
labelname8 = ‘VAbstractInternal’;
labelname9 = ‘VFace’;
labelname10 = ‘VHand’;
labelname11 = ‘VFoot’;
labelname12 = ‘VNature’;
labelname13 = ‘Hashmarks’;

cfg.decoding.software = ‘similarity’;
cfg.decoding.method = ‘classification’;
cfg.decoding.train.classification.model_parameters = ‘pearson’; % this is pearson correlation
cfg.results.output = ‘other_average’;
cfg.scale.method = ‘min0max1’;
cfg.scale.estimation = ‘all’; % scaling across all data is equivalent to no scaling (i.e. will yield the same results), it only changes the data range which allows libsvm to compute faster
cfg.plot_selected_voxels = 0; % 0: no plotting, 1: every step, 2: every second step, 100: every hundredth step…
regressor_names = design_from_spm(beta_loc);
cfg = decoding_describe_data(cfg,{labelname1 labelname2 labelname3 labelname4 labelname5 labelname6 labelname7 labelname8 labelname9 labelname10 labelname11 labelname12 labelname13},[1 2 3 4 5 6 7 8 9 10 11 12 13],regressor_names,beta_loc);
cfg.design = make_design_similarity(cfg);
results = decoding(cfg);

Thank you in advance and have a good day :slightly_smiling_face:

Maxime

Hi!

Have you found a solution to question (2)? I’m also stuck there! Thank you!

Gaia

Hi Gaia,

The variable mask_index tells you about the location of the voxels. I think it might also contain xyz coordinates in raw space. Converting that to MNI coordinates is something that has been discussed in the SPM list a lot but I’d be happy to help. Please let me know more details about what you would like to achieve.

Best,
Martin

Hi Martin,

Could you provide a solution for the first problem? I’m also stuck here unfortunately. ‘other_average’ and ‘other’ produce the same matrix with correlation between every run. Thanks!

I have also been struggling with this problem. Any solutions would be greatly appreciated.

Hi,

I’m sorry, I didn’t receive a notification for some reason.

Out of the top of my head, I do not know which command is the best and would have to dig a little deeper (happy to do so in case you get stuck again!). However, a quick fix would be to provide your input data in the right format for RSA at the averaged level. That would mean you could average your betas across runs first and create con-images (this would be done by setting 1 in SPM for all contrasts you would want to average, or you could do this programmatically). Next, you would set up your decoding design manually, i.e. you specify the files you would like to include in your analysis (in the original version, this should now be 13 files rather than 52). This is described in detail in the decoding tutorial. Finally, you run the RSA analysis again.

I hope this helps you move forward! Sorry again for the delay in my response.

Martin

P.S.: The way in which this is set up - per default creating one very large matrix - is still a remnant from the original version where we tried to create a general purpose correlation matrix / RSA / pattern component modeling tool. It turned out that everyone wanted to run RSA, and I’m hoping that once we can launch the new version of the toolbox we can provide RSA as a separate utility - and thus a separate toolbox.