Example #1
0
import unittest
import connectome
import fibers
import nibabel

fib = fibers.read('test_data/fibers/CMTK_scale33.trk')
roi = nibabel.load('test_data/images/CMTK_roi.nii.gz')
node_info = 'test_data/connectome/freesurfer_node_info.graphml'


class Test_TNConnectome(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_can_generate_connectome_from_fibers_and_rois(self):
        assert connectome.generate_connectome(fib, roi) is not None

    def test_node_info(self):
        my_connectome = connectome.generate_connectome(fib,
                                                       roi,
                                                       node_info=node_info)
        assert my_connectome.node[82]['name'] == 'Left-Amygdala'
        assert my_connectome.node[82]['region'] == 'subcortical'
        assert my_connectome.node[82]['hemisphere'] == 'left'

    def test_can_set_clinical_info(self):
        test_info = dict(group='foo', gender='F', a_score=114.56, b_score=5)
        my_connectome = connectome.generate_connectome(fib, roi)
Example #2
0
import unittest
import fibers

FIBERS_DIR = 'test_data/fibers'
IMAGES_DIR = 'test_data/images'

# load trackvis files up front and share between all tests, otherwise,
# tests take too long to run
f_cmtk = fibers.read("%s/CMTK_scale33.trk" % FIBERS_DIR)  # CMTK
f_dtk = fibers.read("%s/DTK_RungeKutta.trk" % FIBERS_DIR) # DTK

class Test_TNImages(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_can_get_sum_of_inverse_lengths(self):
        # TODO: I need a better test for this, basically I need to
        # generate well-defined NIFTI images w/ more complexity than I
        # currently have and test the results
        pass
        
    def test_can_load_trackvis(self):
        global f_cmtk
        assert f_cmtk is not None

    def test_can_get_data(self):
        # test trackfile has a fiber count of 230814 according to
Example #3
0
import unittest
import connectome
import fibers
import nibabel

fib = fibers.read('test_data/fibers/CMTK_scale33.trk')
roi = nibabel.load('test_data/images/CMTK_roi.nii.gz')
node_info = 'test_data/connectome/freesurfer_node_info.graphml'

class Test_TNConnectome(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_can_generate_connectome_from_fibers_and_rois(self):
        assert connectome.generate_connectome(fib, roi) is not None
    
    def test_node_info(self):
        my_connectome = connectome.generate_connectome(fib, roi, node_info=node_info)
        assert my_connectome.node[82]['name'] == 'Left-Amygdala'
        assert my_connectome.node[82]['region'] == 'subcortical'
        assert my_connectome.node[82]['hemisphere'] == 'left'

    def test_can_set_clinical_info(self):
        test_info = dict( group='foo',
                          gender='F',
                          a_score=114.56,
                          b_score=5 )
Example #4
0
import unittest
import fibers

FIBERS_DIR = 'test_data/fibers'
IMAGES_DIR = 'test_data/images'

# load trackvis files up front and share between all tests, otherwise,
# tests take too long to run
f_cmtk = fibers.read("%s/CMTK_scale33.trk" % FIBERS_DIR)  # CMTK
f_dtk = fibers.read("%s/DTK_RungeKutta.trk" % FIBERS_DIR)  # DTK


class Test_TNImages(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_can_get_sum_of_inverse_lengths(self):
        # TODO: I need a better test for this, basically I need to
        # generate well-defined NIFTI images w/ more complexity than I
        # currently have and test the results
        pass

    def test_can_load_trackvis(self):
        global f_cmtk
        assert f_cmtk is not None

    def test_can_get_data(self):
        # test trackfile has a fiber count of 230814 according to