def test_KSpaceTriangular_get_label_dict(self): test_kspace = KSpaceTriangular() self.assertTrue(test_kspace.has_labels()) self.assertEqual( test_kspace.labels(), ['Gamma', 'M', 'K', 'Gamma'], )
def test_KSpaceTriangular_string_representation_no_interpolation(self): k_interpolation = 0 target = '\n'.join(['(list', ' (vector3 0 0 0) ;Gamma', ' (vector3 0 0.5 0) ;M', ' (vector3 (/ -3) (/ 3) 0) ;K', ' (vector3 0 0 0) ;Gamma', ')']) test_kspace = KSpaceTriangular(k_interpolation=k_interpolation) self.assertEqual(str(test_kspace), target)
def test_KSpaceTriangular_string_representation_no_labels_no_interpolation(self): k_interpolation = 0 target = '\n'.join(['(list', ' (vector3 0 0 0)', ' (vector3 0 0.5 0)', ' (vector3 (/ -3) (/ 3) 0)', ' (vector3 0 0 0)', ')']) test_kspace = KSpaceTriangular(k_interpolation=k_interpolation) # remove labels: test_kspace.point_labels=[] self.assertEqual(str(test_kspace), target)
def test_KSpaceTriangular_string_representation_uniform_interpolation( self): k_interpolation = 8 target = '\n'.join(['(%s %i (list', ' (vector3 0 0 0) ;Gamma', ' (vector3 0 0.5 0) ;M', ' (vector3 (/ -3) (/ 3) 0) ;K', ' (vector3 0 0 0) ;Gamma', '))']) % ( defaults.k_uniform_interpolation_function, k_interpolation) test_kspace = KSpaceTriangular( k_interpolation=k_interpolation, use_uniform_interpolation=True) self.assertEqual(str(test_kspace), target)
def test_KSpaceTriangular_get_label_dict_no_labels(self): test_kspace = KSpaceTriangular() # remove labels: test_kspace.point_labels=[] self.assertFalse(test_kspace.has_labels()) self.assertEqual(test_kspace.labels(), [])
def test_KSpaceTriangular_count_interpolated(self): k_interpolation = 10 target = 34 test_kspace = KSpaceTriangular(k_interpolation=k_interpolation) self.assertEqual(test_kspace.count_interpolated(), target)