help > RE: Cluster extent thresholding of first-level connectivity maps
Jan 25, 2018  02:01 PM | Kasia Siuda - Institut du Cerveau et de la Moelle Epiniere
RE: Cluster extent thresholding of first-level connectivity maps
Dear Stephen,

Thank you very much for this exhaustive response!

For the voxel-wise correction, I checked a box in CONN set-up options to create first level seed-to-voxel FDR corrected p maps. Then I threshold them at 0.05 and use them to mask the corresponding first level r-maps. That way I get r maps at p=0.05 FDR corrected. Is your approach the same?

The problem is that I still get small clusters (k<5) of highly significant voxels, partially in a lesion site, so they are most probably meaningless. In order to clear my image from them, I wrote a function that applies a cluster extent threshold at a given k. Maybe someone will need it, so I put it below:



function [no_small_cluster_matrix] = cluster_size_threshold(img,cluster_threshold)
%given an .nii activation/connectivity map (img), this function provides a
%cluster extend threshold at a given number of voxels (cluster_threshold)

% example: cluster_size_threshold(pFDRcorrected_r_map.nii, 10)

% output: a .nii file with the same name as input image and a suffix: k>cluster_threshold (eg. pFDRcorrected_r_map_k>10.nii)

spm_struct = spm_vol(img);
matrix = spm_read_vols(spm_struct);

I = find(matrix); %find non-zero voxels
[x,y,z]=ind2sub(spm_struct.dim, I);
L = [x y z ]'; %%% locations in voxels
clusterindex = spm_clusters(L); %finds indices of clusters

[cluster_size,cluster_number]=hist(clusterindex,unique(clusterindex));
big_cluster_indices = cluster_number(cluster_size>cluster_threshold);

without_small_clusters_I = I(ismember(clusterindex, big_cluster_indices));

template = zeros(spm_struct.dim);
lin_no_small_cluster_matrix = template(:);
lin_no_small_cluster_matrix(without_small_clusters_I)=1;
no_small_cluster_binary_matrix = reshape(lin_no_small_cluster_matrix, spm_struct.dim);

no_small_cluster_matrix = no_small_cluster_binary_matrix.*matrix;

no_small_cluster_struct_file = spm_struct;
no_small_cluster_struct_file.fname = [spm_struct.fname '_k>' num2str(cluster_threshold)'
no_small_cluster_struct_file = spm_create_vol(no_small_cluster_struct_file);
spm_write_vol(no_small_cluster_struct_file,no_small_cluster_matrix);
end

All the best, Kasia

Threaded View

TitleAuthorDate
Kasia Siuda Dec 22, 2017
Stephen L. Jan 15, 2018
RE: Cluster extent thresholding of first-level connectivity maps
Kasia Siuda Jan 25, 2018
Stephen L. Feb 1, 2018