unravel.voxel_stats.vstats module#
Use vstats
(vs
) from UNRAVEL to run voxel-wise stats using FSL’s randomise_parallel command.
- Prereqs:
Input images from
vstats_prep
,vstats_z_score
, orvstats_whole_to_avg
.
- Inputs:
*.nii.gz files in the current directory with conditions as prefixes (e.g., saline_1.nii.gz, saline_2.nii.gz, drug_1.nii.gz, drug_2.nii.gz)
- Outputs:
stats/ directory with randomise_parallel outputs (e.g., uncorrected 1-p value maps [vox_p]).
The name of the current directory is used as the prefix for the output files.
- Next commands:
Run
cstats_fdr_range
andcstats_fdr
to correct for multiple comparisons.
Note
1 minus p (1-p) value maps are made for visualization (e.g., in FSLeyes), so use 0.95 as the uncorrect threshold for alpha = 0.05.
The –options flag is used to pass additional options to the randomise command.
It should be the last flag specified in the command.
The options should be specified as separate strings, e.g., –options –seed=1 -T
For info on how to set up and run voxel-wise analyses, see: https://b-heifets.github.io/UNRAVEL/guide.html#voxel-wise-stats
For a t-test design, tstat1 is group1 > group2 and tstat2 is group2 > group1 (conditions are sorted alphabetically)
For an ANOVA design, fstat1 is the first contrast, fstat2 is the second contrast, and so on (these are 1-p value maps are non-directional)
Usage:#
vstats [-mas mask.nii.gz] [-p 18000] [–kernel 0] [-a atlas/atlas_CCFv3_2020_30um.nii.gz] [-v] [–options –seed=1]
- unravel.voxel_stats.vstats.check_fdr_command()[source]#
Check if the ‘fdr’ command is available in the system’s path.
- unravel.voxel_stats.vstats.create_design_ttest2(mat_file, group1_size, group2_size)[source]#
Create design matrix for a two-group unpaired t-test.
- unravel.voxel_stats.vstats.calculate_fragments(num_contrasts, total_permutations_per_contrast=18000, permutations_per_fragment=300)[source]#
Calculate the total number of fragments based on the number of contrasts.