Пример #1
0
 def test_wrong_order_type(self):
     with self.assertRaises(TypeError):
         RandomBiasField(order='wrong')
Пример #2
0
 def test_no_bias(self):
     transform = RandomBiasField(coefficients=0.)
     transformed = transform(self.sample_subject)
     self.assertTensorAlmostEqual(self.sample_subject.t1.data, transformed.t1.data)
Пример #3
0
 def test_negative_order(self):
     with self.assertRaises(ValueError):
         RandomBiasField(order=-1)
Пример #4
0
 def test_wrong_coefficient_type(self):
     with self.assertRaises(ValueError):
         RandomBiasField(coefficients='wrong')
Пример #5
0
 def test_no_bias(self):
     transform = RandomBiasField(coefficients=0.)
     transformed = transform(self.sample)
     assert_array_equal(self.sample.t1.data, transformed.t1.data)
Пример #6
0
 def test_with_bias(self):
     transform = RandomBiasField(coefficients=0.1)
     transformed = transform(self.sample)
     with self.assertRaises(AssertionError):
         assert_array_equal(self.sample.t1.data, transformed.t1.data)
Пример #7
0
 def test_with_bias(self):
     transform = RandomBiasField(coefficients=0.1)
     transformed = transform(self.sample)
     self.assertTensorNotEqual(self.sample.t1.data, transformed.t1.data)