Creates spatial blocks from a 3D mask for use with spatial_fdr. This is useful for voxelwise analyses where you want to group nearby voxels together for more powerful multiple comparisons correction.
Usage
create_3d_blocks(mask, block_size = c(10, 10, 10), connectivity = 26)
Arguments
- mask
Numeric 3D array or NeuroVol object defining the brain mask. Non-zero values indicate voxels to include.
- block_size
Integer vector of length 3 specifying block dimensions in voxels (default: c(10, 10, 10))
- connectivity
Integer scalar; type of connectivity for neighbors: 6 (face connectivity) or 26 (face, edge, and corner connectivity). Default: 26