-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_rcw.py
49 lines (30 loc) · 1.13 KB
/
test_rcw.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
''' test the cogFusion_rcw'''
# to test this, do:
#
# from test_rcw import *
# test_all()
#
# this does require an original/ directory and the EPI_MASK_NOEYES.img/hdr pair.
#
# answer should be:
#
# ['original/3153.nii.gz', 'original/3154.nii.gz', 'original/3155.nii.gz']
# ['EPI_MASK_NOEYES.img']
# testing contrastDocProductAvg
# 1.0
# testing contrastAvgDocProduct
# [1.0000000000000002, 0.96397000438290426, 0.47014563818126826, 0.96397000438290426, 0.99999999999999989, 0.47736370554624213, 0.47014563818126831, 0.47736370554624213, 1.0]
from cogFusion_rcw import *
def test_all():
nameList = ["original/3153.nii.gz", "original/3154.nii.gz","original/3155.nii.gz"]
print(nameList)
maskList = ["EPI_MASK_NOEYES.img"]
print(maskList)
testImageList = readImageList(nameList)
maskImage = readImageList(maskList)
ans1 = contrastDotProductAvg(testImageList,testImageList,maskImage)
print("testing contrastDocProductAvg")
print(ans1)
print("testing contrastAvgDocProduct")
ans2 = contrastAvgDotProduct(testImageList,testImageList,maskImage)
print(ans2)