-
Notifications
You must be signed in to change notification settings - Fork 10
/
tests_maps.py
81 lines (59 loc) · 1.94 KB
/
tests_maps.py
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
# tests for narps code
# - currently these are all just smoke tests
import pytest
import os
import pandas
from narps import Narps
from AnalyzeMaps import mk_overlap_maps,\
mk_range_maps, mk_std_maps,\
mk_correlation_maps_unthresh, analyze_clusters,\
plot_distance_from_mean, get_thresh_similarity
from MetaAnalysis import get_thresholded_Z_maps
from ThreshVoxelStatistics import get_thresh_voxel_stats,\
get_zstat_diagnostics
from GetMeanSimilarity import get_similarity_summary
# Use a fixed base dir so that we can
# access the results as a circleci artifact
@pytest.fixture(scope="session")
def narps():
basedir = '/tmp/data'
assert os.path.exists(basedir)
narps = Narps(basedir)
narps.load_data()
narps.metadata = pandas.read_csv(
os.path.join(narps.dirs.dirs['metadata'], 'all_metadata.csv'))
return(narps)
# tests
# AnalyzeMaps
def test_mk_overlap_maps(narps):
# create maps showing overlap of thresholded images
mk_overlap_maps(narps)
def test_mk_range_maps(narps):
mk_range_maps(narps)
def test_mk_std_maps(narps):
mk_std_maps(narps)
def test_unthresh_correlation_analysis(narps):
# conbine these into a single test
# since they share data
corr_type = 'spearman'
dendrograms, membership = mk_correlation_maps_unthresh(
narps, corr_type=corr_type)
_ = analyze_clusters(
narps,
dendrograms,
membership,
corr_type=corr_type)
def test_plot_distance_from_mean(narps):
plot_distance_from_mean(narps)
def test_get_thresh_similarity(narps):
get_thresh_similarity(narps)
# this was created for ALE but we do it earlier here
def test_thresh_zmap(narps):
# create thresholded versions of Z maps
narps = get_thresholded_Z_maps(
narps)
def test_thresh_voxel_stats(narps):
get_zstat_diagnostics(narps)
get_thresh_voxel_stats(narps.basedir)
def test_mean_similarity(narps):
_ = get_similarity_summary(narps)