Ejemplo n.º 1
0
 def test_offset(self):
     lut = linear_lut(10, 265, fill=True)
     expected_lut = np.zeros(266, dtype='uint8')
     expected_lut[:10] = 0
     expected_lut[10:] = np.linspace(0, 255, 256)
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
Ejemplo n.º 2
0
 def test_offset(self):
     lut = linear_lut(10, 265, fill=True)
     expected_lut = np.zeros(266, dtype='uint8')
     expected_lut[:10] = 0
     expected_lut[10:] = np.linspace(0, 255, 256)
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
Ejemplo n.º 3
0
 def test_fill_false1(self):
     lut = linear_lut(100, 199)
     self.assertEqual(len(lut), 200)
Ejemplo n.º 4
0
 def test_dtype_uint16(self):
     lut = linear_lut(dtype='uint16')
     self.assertEqual(lut.dtype, np.uint16)
     self.assertTrue(np.all(lut == np.arange(2 ** 16, dtype='uint16')))
Ejemplo n.º 5
0
 def test_all_defaults(self):
     lut = linear_lut()
     self.assertEqual(lut.dtype, np.uint8)
     self.assertTrue(np.all(lut == np.arange(2 ** 8, dtype='uint8')))
Ejemplo n.º 6
0
 def test_vmin_omin(self):
     lut = linear_lut(10, 209, omin=10, omax=209)
     expected_lut = np.arange(210)
     expected_lut[:10] = 10
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
Ejemplo n.º 7
0
 def test_vmin_omin(self):
     lut = linear_lut(10, 209, omin=10, omax=209)
     expected_lut = np.arange(210)
     expected_lut[:10] = 10
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
Ejemplo n.º 8
0
 def test_fill1(self):
     lut = linear_lut(100, 199, fill=500)
     self.assertEqual(len(lut), 500)
Ejemplo n.º 9
0
 def test_fill2(self):
     lut = linear_lut(100, 3000, fill=500)
     self.assertEqual(len(lut), 3001)
Ejemplo n.º 10
0
 def test_fill1(self):
     lut = linear_lut(100, 199, fill=500)
     self.assertEqual(len(lut), 500)
Ejemplo n.º 11
0
 def test_fill_true2(self):
     lut = linear_lut(100, 3000, fill=True)
     self.assertEqual(len(lut), 3001)
Ejemplo n.º 12
0
 def test_fill_true1(self):
     lut = linear_lut(100, 199, fill=True)
     self.assertEqual(len(lut), 256)
Ejemplo n.º 13
0
 def test_fill_false1(self):
     lut = linear_lut(100, 199)
     self.assertEqual(len(lut), 200)
Ejemplo n.º 14
0
 def test_dtype_uint16(self):
     lut = linear_lut(dtype='uint16')
     self.assertEqual(lut.dtype, np.uint16)
     self.assertTrue(np.all(lut == np.arange(2**16, dtype='uint16')))
Ejemplo n.º 15
0
 def test_all_defaults(self):
     lut = linear_lut()
     self.assertEqual(lut.dtype, np.uint8)
     self.assertTrue(np.all(lut == np.arange(2**8, dtype='uint8')))
Ejemplo n.º 16
0
 def test_fill_true1(self):
     lut = linear_lut(100, 199, fill=True)
     self.assertEqual(len(lut), 256)
Ejemplo n.º 17
0
 def test_fill_true2(self):
     lut = linear_lut(100, 3000, fill=True)
     self.assertEqual(len(lut), 3001)
Ejemplo n.º 18
0
 def test_scale(self):
     lut = linear_lut(0, 511)
     expected_lut = np.arange(256)
     expected_lut = np.repeat(expected_lut, 2)
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
Ejemplo n.º 19
0
 def test_fill2(self):
     lut = linear_lut(100, 3000, fill=500)
     self.assertEqual(len(lut), 3001)
Ejemplo n.º 20
0
 def test_omin(self):
     lut = linear_lut(0, 399, omin=10, omax=209)
     expected_lut = np.arange(200)
     expected_lut = np.repeat(expected_lut, 2) + 10
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
Ejemplo n.º 21
0
 def test_scale(self):
     lut = linear_lut(0, 511)
     expected_lut = np.arange(256)
     expected_lut = np.repeat(expected_lut, 2)
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))
Ejemplo n.º 22
0
 def test_omin(self):
     lut = linear_lut(0, 399, omin=10, omax=209)
     expected_lut = np.arange(200)
     expected_lut = np.repeat(expected_lut, 2) + 10
     self.assertEqual(len(lut), len(expected_lut))
     self.assertTrue(np.all(lut == expected_lut))