Git Product home page Git Product logo

cvmanova's Introduction

I am a Lecturer in Psychology at City, University of London, where I work on statistical data analysis methods for cognitive neuroscience and psychology, and teach about statistical methods and their implementation in Matlab, R, and Python. My background is in physics (nonlinear dynamics).

My repositories contain

I also use GitHub to publish a random collection of nerdy notes.

cvmanova's People

Contributors

allefeld avatar remi-gau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cvmanova's Issues

Issue in contrasts with parametric regressors

Dear Dr. Allefeld,
I was trying to run the cvMANOVA on my dataset and I encountered an issue.
My task is a 2x2 factorial design (factors: category (2) and familiarity (2)), with 9 runs (sessions) in total.
For each session, I have the following regressors:

• 4 parametric regressors modelling each factorial combination of category and familiarity. For each of these 4 aggressors,

we also added a parametric modulator.
• 2 regressors modelling auditory cues and subject’s response
• 6 confound regressors modelling motion correction parameters.

In addition, in some participants we have an additional regressor modelling errors (or missed responses), that we inserted at the very end, so that it can be zero-padded by your function as reported in the readme.txt file.
The issue we are encountering is relative to setting up the contrasts for the cvMANOVA. We are interested for the moment in computing category and familiarity main effects, both for “regular” regressors and for their parametric counterpart, to understand where in the brain neural response is modulated by our parameter.
We set up the contrasts as follows:

%Main effect
Cs{1} = [1 0 -1 0 1 0 -1 0 0 0];

%Parametric main effect
Cs{2} = [0 1 0 -1 0 1 0 -1 0 0];

In the second contrast, we aim to replicate the first but this time using the parametric regressors factorXparameterXbf, as reported in SPM.
When we run the cvMANOVA, we encounter the following error:

Error using cvManovaCore (line 82)
contrast 2 is not estimable in session X!

This happens only with the parametric contrast, with the “regular” main effect the computation starts just fine. We tried on multiple subjects, the same error message appears and the session number that creates the error varies systematically.
Following another question we found in this thread (#27) and thinking the error might be due to the additional regressor present in some participants, we tried and run the cvMANOVA only in participants which did not commit any error (so with an equal number of regressors in each run), but the same error message appeared.
Here I attach an SPM.mat file of a participant without the additional error regressor (https://we.tl/t-F2tSL0yLdv).
Thanks for your help.
Best,

Flavio

searchlight size error

Hi Carsten

After loading a dataset
100 of 365 volumes loaded
200 of 365 volumes loaded
300 of 365 volumes loaded
365 of 365 volumes loaded
whitening
high-pass-filtering
df: 365 - 11 - 10 = 344 [SPM: trRV = 344 erdf = 344]

I get the error : "Error using cvManovaSearchlight (line 67)
data insufficient for searchlight of size 257!"

I've tried different searchlight sizes without success.

---> if pMax > fEMin * 0.9 % ensures decent numerical precision

seems that the images doesn't meet this criteria....?

thanks and best, mike

cvManovaRegion

Hi,

I have another issue with cvManovaRegion. The issue is that this works well with some ROI mask, but does not work with some other ROI masks. In my case, I created three ROI region masks, (cell array of 3D volumes of 1 and 0). ROI 1 and 2 have some overlappings and ROI 3 is union of ROIs 1 and 2. The problem is that cvManovaRegion works only for ROI 2, but and ROI 1 and 3, and the error message is that,

data insufficient for the 1259 voxels of region 1!
data insufficient for the 1526 voxels of region 3!

Can you please help? Thanks.

matlabbatch error

When running cvManovaTest, it echos this errors. Thanks very much.

cvManovaTest
analyzing data of subj1 from Haxby et al. (2001)
37 cvManovaTest_model
estimating model


08-Aug-2019 18:32:14 - Running job #1

08-Aug-2019 18:32:14 - Running 'Model estimation'

SPM12: spm_spm (v7120) 18:32:16 - 08/08/2019

08-Aug-2019 18:32:16 - Failed 'Model estimation'
错误使用 spm_spm (line 309)
Data have not been specified.
In file "/Volumes/VMware Shared Folders/E/vm_mac_matlab/spm12/spm_spm.m" (v7120), function "spm_spm" at line 309.
In file "/Volumes/VMware Shared Folders/E/vm_mac_matlab/spm12/config/spm_run_fmri_est.m" (v7354), function "spm_run_fmri_est" at line 36.

The following modules did not run:
Failed: Model estimation

错误使用 MATLABbatch system
Job execution failed. The full log of this run can be found in MATLAB command
window, starting with the lines (look for the line showing the exact #job as
displayed in this error message)

Running job #1

Normalization

Hi,

We were wondering to include normalization of the data (Pereira 2009, Example preprocessing section, https://www.sciencedirect.com/science/article/pii/S1053811908012263) right after data loading.

I think the line 36 in cvManovaRegion.m,
[Ys, Xs, ~, misc] = loadDataSPM(dirName, regions);
is the data loading part

I was wondering if I add following lines? If it does not make sense, can you suggest better way?

Yss{1}=transpose(zscore(transpose(Ys{1})));
Yss{2}=transpose(zscore(transpose(Ys{2})));
Yss{3}=transpose(zscore(transpose(Ys{3})));
Ys=Yss; clearvars Yss;

Thank you.

Pattern and activation

Hi,

This is not the coding issue but an open question. I was wondering if cvMANOVA can capture both 'activation' and 'neural pattern information' of interest. I ask this question because we want to compare standard searchlight and cvMANOVA, and we found standard searchlight was sensitive to typical activation region and others, while cvMANOVA was not sensitive to typical activation region. Is there any way how the method handles differences in activation magnitude?

Thank you.

cvManovaCore

integrating as much stuff as possible into cvManova_compute

in 4d-files, volume indicator suffix ",1" is ignored

removed by fullfile?
no, probably ignored by

    % read data directly (faster)
    y = V.private.dat(:, :, :, V.n(1));
    y = reshape(y, [], V.dim(3));
    y = bsxfun(@plus, bsxfun(@times, y, V.pinfo(1, :)), V.pinfo(2, :));
    Y(i, :) = y(mask);

error loading data in SPM.mat

Hi there

I'm receiving an error while loading the SPM.mat file using cvManovaSearchlight.m:

loading data
via X:\SPM.mat
153926 in-mask voxels
no region mask
reading images
Undefined function 'diff' for input arguments of type 'cell'.

Error in loadDataSPM (line 105)
pattern(~all(diff(SPM.xY.P) == 0)) = '?';

Error in cvManovaSearchlight (line 47)
[Ys, Xs, mask, misc] = loadDataSPM(dirName);

thanks for help!
cheers, mike

minor bugs in cvManovaTest

Hi Allefeld,

Great work and very much appreciated for making the toolbox available!

I cloned the repo today and went through the example with the cvManovaTest scripts, where I encountered 3 minor problems:

  1. websave was introduced in MATLAB R2014b, so I needed to download the dataset manually since I am using MATLAB R2014a.
    see line 8 in cvManoveTest_getdata.m

  2. sprintf runs in trouble in Windows, since the escape character is the same as the file separator.
    see line 10 of cvManovaTest_preprocess.m
    see line 19 of cvManovaTest_model.m

  3. cvManovaTest_preprocess.m uses the same variables (e.g. nRuns) as cvManoveTest_getdata.m. In case the design has been created earlier in another session (exist(fnDesign, 'file') evaluates true in cvManovaTest_getdata.m), then these variables are missing during running cvManovaTest_preprocess.m.

After fixing these minor issues, the code runs smoothly.

Thanks and best,
Agoston

profile memory usage

Really hard to do. It looks like peak memory usage is about double the amount for the loaded data.

Minor bug in fletcher16.m

Dear Dr. Allefeld,
When the ‘date’ in 'spm.mat' contains chinese characters(it is due to the system's language setting), Funcation 'Checksum' will prompt the UID is ‘invalid data’.
I removed the call to the ‘date’ by modifying the code in cvManovaSearchlight.m(line 56,57):

    uid = gencode({‘SPM.mat’ , ...
    slRadius, Cs, permute, lambda});

after that it runs smoothly, maybe there is a better way to solve the bug.
Thanks sincerely for your work.

best
Liu

cvManovaCore contrast error

Hi,

I have 16 conditions and I set up 1 main effect and 1 interaction effect contrasts

% set up contrasts
Cs = {};
% 1) main effect of threat
Cs{1} = [ -1 1 -1 1 0 0 0 0 0 0 0 0 0 0 0 0]';
% 2) interaction
Cs{2} = [ -1 1 1 -1 0 0 0 0 0 0 0 0 0 0 0 0]';

and I ran cvManovaSearchlight,

cvManovaSearchlight(dir, 3, Cs)

but I had error message as follows,

_computing cross-validated MANOVA on searchlight
Error using cvManovaCore (line 82)
contrast 1 is not estimable in session 1!

Error in runSearchlight (line 73)
res = fun(nan(0, 1), varargin{:});

Error in cvManovaSearchlight (line 69)
[D, p] = runSearchlight(['cmsCheckpoint' uid
'.mat'], slRadius, mask, ..._

Can you help me to handle with this? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.