Hi Nick,
thanks for your reply...i tried it, but i still get an error. here's what i have tried:
- calculate searchlight for each subject with cosmo_dissimilarity_matrix_measure
- stack all subjects' searchlight results using cosmo_stack
- use cosmo_slice to get unique combination of targets 1 and targets 2, for instance:
ds_H=cosmo_slice(ds_all, ds_all.sa.targets2==1);
ds_HS=cosmo_slice(ds_H,ds_H.sa.targets1==2);
[H & S index my conditions, or target names, hence i am interested in the dissimilarity between condition 1 and condition 2 across the whole brain]
now i would like to run monte carlo on ds_HS which contains:
samples (n subjects*n voxels)
sa.targets1, sa.targets2, no chunks.
as you suggested, i manually add chunks as 1:number of subjects & targets set to 1:
ds_HS.sa.targets=ones(1,n_subjects)';
ds_HS.sa.chunks=(1:n_subjects)';
then i calculate the neighborhood:
nbrhood=cosmo_spherical_neighborhood(ds_HS,'count',n_voxels);
and when i try to use cosmo_montecarlo_cluster_stat (i want tfce as an output)-
ds_MC=cosmo_montecarlo_cluster_stat(ds_HS,nbrhood,'niter',10000,'h0_mean',0,...
'feature_stat','auto','cluster_stat','tfce','dh',0.1);
I get -
>>error using cosmo_montecarlo_cluster_stat>get_clusterizer_func (line 790)
option 'feature_sizes' is not provided, and neighborhood struct does not contain a field .fa.sizes. This
probably means that the neighborhood was not created using cosmo_cluster_neighborhood (which sets this
feature attribute appropriately)
Background: cluster measure usually requires the relative size of each feature. For example:
- in a volumetric fMRI dataset it can be a row vector of ones, because all voxels have the same size
- in a surface-based dataset it should be the area of each node (such as computed by surfing_surfacearea in
the surfing toolbox).
Your options are:
- generate the neighborhood using cosmo_cluster_neighborhood. This is the easiest option and should be used
unless you are using a custom cluster neighborhood.
- set the .fa.sizes manually.
Error in cosmo_montecarlo_cluster_stat (line 295)
cluster_func=get_clusterizer_func(nbrhood,opt);
then I tried -
ds_HS.fa.sizes=ones(1,n_voxels);
but I still get this error.
also tired without h0, then i get another error stating that ho is needed.
i guess something with the neighborhood is not right. maybe i should compute it in another way or at a different stage at my code? or maybe my implementation of cosmo_montecarlo_cluster_stat is wrong?
thanks a lot,
Adi