-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpower_calculator_test_script.m
More file actions
97 lines (60 loc) · 2.47 KB
/
power_calculator_test_script.m
File metadata and controls
97 lines (60 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
%% test_workflow
% Executes a full test suite to validate the statistical power calculator framework.
%
% This script runs unit and integration tests for multiple core components,
% including edge-based and network-based inference, contrast-based test detection,
% and ground-truth benchmarking validation. It ensures that test datasets are
% correctly created, inference types are properly identified, and statistical
% procedures return outputs in expected formats.
%
% Workflow
% - Create synthetic datasets for t-tests (one-sample, two-sample, and correlation).
% - Run statistical procedures:
% - `edge_based_tests`: Executes edge-level statistical methods.
% - `network_based_tests`: Executes network-level inference using an atlas.
% - Validate inference-type detection using contrast labels.
% - Verify integration between simulated ground truth and power estimation.
%
% Notes
% - This test suite is designed for local execution and development.
% - Omnibus test validation is not yet implemented
clear;
clc;
%% Test hpc one sample t-tests
scriptDir = fileparts(mfilename('fullpath'));
addpath(genpath(scriptDir));
cd(scriptDir);
compile_mex()
cd(scriptDir);
% Test if retrieval of subject scores matches what is expected
% tests subs_data_from_score_condition function
test_subs_score_retrieval()
% test if calculation status is proper
test_check_calculation_status()
clean_test_directories()
create_test_fc_data_set()
create_test_fc_atlas()
edge_based_tests('test_t2_fc.mat', 'file_structure', 'compact_file')
% Avoid errors where the same file already exists but is in a different
% format
clean_test_directories()
edge_based_tests('test_hcp_fc.mat')
network_based_tests('test_hcp_fc.mat')
%% Test inference type from data
data_inference_from_contrast_test()
%% Test power calculator
% I am going to depracate this power test
% I need to rewrite it as a full pipeline
% test_power_calculation_from_gt_and_data()
%% Create t2-test dataset
create_t2_test_dataset()
edge_based_tests('test_t2_fc.mat')
network_based_tests('test_t2_fc.mat')
create_r_test_dataset()
edge_based_tests('test_r_fc.mat')
network_based_tests('test_r_fc.mat')
create_act_test_dataset()
edge_based_tests('test_act_act', 'stat_method_cell', {'Parametric', 'Size_Node_cpp', 'IC_TFCE_Node_cpp'}, ...
'submethod_cell', {'FWER', 'FDR'}', ...
'full_method_name_cell', {'Parametric_FWER', 'Parametric_FDR', 'Size_Node_cpp', 'IC_TFCE_Node_cpp'})
fprintf('Finished test routine correctly\n')