forked from ZitongLu1996/NeuroRA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
t_nii_save.py
executable file
·36 lines (25 loc) · 1.08 KB
/
t_nii_save.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
# -*- coding: utf-8 -*-
' a module for testing neurora.nii_save module '
__author__ = 'Zitong Lu'
import numpy as np
import unittest
from neurora.nii_save import corr_save_nii, stats_save_nii
class test_nii_save(unittest.TestCase):
def test_corr_save_nii(self):
corrs = np.random.rand(51, 61, 51, 2)
affine = np.random.rand(3, 3)
output = corr_save_nii(corrs, affine=affine, size=[53, 63, 53])
self.assertEqual(output, "Invalid input!")
corrs = np.random.rand(51, 61, 51)
output = corr_save_nii(corrs, affine=affine, size=[53, 63, 53])
self.assertEqual(output, "Invalid input!")
def test_stats_save_nii(self):
stats = np.random.rand(51, 61, 51, 2)
affine = np.random.rand(3, 3)
output = stats_save_nii(stats, affine=affine, size=[53, 63, 53])
self.assertEqual(output, "Invalid input!")
stats = np.random.rand(51, 61, 51)
output = stats_save_nii(stats, affine=affine, size=[53, 63, 53])
self.assertEqual(output, "Invalid input!")
if __name__ == '__main__':
unittest.main()