def test_smoke_datatypes(self): self.check_skip() SHAPE = (300, 300) # simple "smoke" test to see if numba explodes dummy_image = np.random.randint(0, 100, SHAPE).astype(np.uint8) tp.locate(dummy_image, 5, engine=self.engine) tp.locate(invert_image(dummy_image), 5, engine=self.engine) # Check float types dummy_image = np.random.rand(*SHAPE) tp.locate(dummy_image, 5, engine=self.engine) tp.locate(invert_image(dummy_image), 5, engine=self.engine)
def test_smoke_datatypes(self): self.check_skip() SHAPE = (300, 300) # simple "smoke" test to see if numba explodes dummy_image = np.random.randint(0, 100, SHAPE).astype(np.uint8) tp.locate(dummy_image, 5, engine=self.engine) tp.locate(invert_image(dummy_image), 5, engine=self.engine) # Check float types dummy_image = np.random.rand(*SHAPE) tp.locate(dummy_image, 5, engine=self.engine) tp.locate(invert_image(dummy_image), 5, engine=self.engine)
def setUpClass(cls): super(TestReproducibility, cls).setUpClass() # generate a new file video = pims.ImageSequence( os.path.join(path, 'video', 'image_sequence')) actual = tp.batch(invert_image(video), diameter=9, minmass=240) actual = tp.link_df(actual, search_range=5, memory=2) actual.to_csv(reproduce_fn)
def test_oldmass_invert(self): old_minmass = 2800000 im = draw_spots(self.shape, self.pos, self.size, bitdepth=12, noise_level=500) im = (im.max() - im + 10000) new_minmass = self.minmass_v02_to_v04(im, old_minmass, invert=True) f = tp.locate(invert_image(im), self.tp_diameter, minmass=new_minmass) assert len(f) == self.N
def test_oldmass_invert(self): old_minmass = 2800000 im = draw_spots(self.shape, self.pos, self.size, bitdepth=12, noise_level=500) im = (im.max() - im + 10000) new_minmass = tp.minmass_version_change(im, old_minmass, invert=True, smoothing_size=self.tp_diameter) f = tp.locate(invert_image(im), self.tp_diameter, minmass=new_minmass) assert len(f) == self.N
def setUpClass(cls): super(TestReproducibility, cls).setUpClass() npz = np.load(reproduce_fn) cls.expected_find_raw = npz['arr_0'] cls.expected_find_bp = npz['arr_1'] cls.expected_refine = npz['arr_2'] cls.expected_locate = npz['arr_3'] cls.coords_link = npz['arr_4'] cls.expected_link = npz['arr_5'] cls.expected_link_memory = npz['arr_6'] cls.expected_characterize = npz['arr_7'] cls.v = TrackpyImageSequence(os.path.join(path, 'video', 'image_sequence', '*.png')) cls.v0_inverted = invert_image(cls.v[0])
def setUpClass(cls): super(TestReproducibility, cls).setUpClass() npz = np.load(reproduce_fn) cls.expected_find_raw = npz['arr_0'] cls.expected_find_bp = npz['arr_1'] cls.expected_refine = npz['arr_2'] cls.expected_locate = npz['arr_3'] cls.coords_link = npz['arr_4'] cls.expected_link = npz['arr_5'] cls.expected_link_memory = npz['arr_6'] cls.expected_characterize = npz['arr_7'] cls.v = pims.ImageSequence(os.path.join(path, 'video', 'image_sequence', '*.png')) cls.v0_inverted = invert_image(cls.v[0])