def setUp(self): _skip_if_no_imread() self.filepath = os.path.join(path, 'image_sequence3d') self.filenames = [ 'file_t001_z001_c1.png', 'file_t001_z001_c2.png', 'file_t001_z002_c1.png', 'file_t001_z002_c2.png', 'file_t002_z001_c1.png', 'file_t002_z001_c2.png', 'file_t002_z002_c1.png', 'file_t002_z002_c2.png', 'file_t003_z001_c1.png', 'file_t003_z001_c2.png', 'file_t003_z002_c1.png', 'file_t003_z002_c2.png' ] shape = (10, 11) frames = save_dummy_png(self.filepath, self.filenames, shape) self.filename = os.path.join(self.filepath, '*.png') self.frame0 = np.array([frames[0], frames[2]]) self.frame1 = np.array([frames[4], frames[6]]) self.klass = pims.ImageSequenceND self.kwargs = dict(axes_identifiers='tzc') self.v = self.klass(self.filename, **self.kwargs) self.v.default_coords['c'] = 0 self.expected_len = 3 self.expected_Z = 2 self.expected_C = 2 self.expected_shape = (self.expected_Z, ) + shape
def setUp(self): _skip_if_no_skimage() self.filepath = os.path.join(path, 'image_sequence') self.filenames = [ 'T76S3F00001.png', 'T76S3F00002.png', 'T76S3F00003.png', 'T76S3F00004.png', 'T76S3F00005.png' ] shape = (10, 11) frames = save_dummy_png(self.filepath, self.filenames, shape) self.filename = os.path.join(self.filepath, '*.png') self.frame0 = frames[0] self.frame1 = frames[1] self.kwargs = dict(plugin='matplotlib') self.klass = pims.ImageSequence self.v = self.klass(self.filename, **self.kwargs) self.expected_shape = shape self.expected_len = 5
def setUp(self): _skip_if_no_imread() self.filepath = os.path.join(path, 'image_sequence3d') self.filenames = [ 'file001.png', 'file002.png', 'file003.png', 'file004.png' ] shape = (10, 11, 3) frames = save_dummy_png(self.filepath, self.filenames, shape) self.filename = os.path.join(self.filepath, '*.png') self.frame0 = frames[0] self.frame1 = frames[1] self.klass = pims.ReaderSequence self.kwargs = dict(reader_cls=pims.ImageReaderND, axis_name='t') self.v = self.klass(self.filename, **self.kwargs) self.v.bundle_axes = 'yxc' self.v.iter_axes = 't' self.expected_len = 4 self.expected_C = 3 self.expected_shape = (10, 11, 3)
def setUp(self): _skip_if_no_skimage() self.filepath = os.path.join(path, 'image_sequence') self.filenames = [ 'T76S3F00001.png', 'T76S3F00002.png', 'T76S3F00003.png', 'T76S3F00004.png', 'T76S3F00005.png' ] shape = (10, 11) frames = save_dummy_png(self.filepath, self.filenames, shape) self.filename = os.path.join(self.filepath, '*.png') self.frame0 = frames[0] self.frame1 = frames[1] self.kwargs = dict(plugin='pil') self.klass = pims.ImageSequence self.v = self.klass(self.filename, **self.kwargs) self.expected_shape = shape self.expected_len = 5 self.tempdir = tempfile.mkdtemp() self.tempfile = os.path.join(self.tempdir, 'test.zip') with zipfile.ZipFile(self.tempfile, 'w') as archive: for fn in self.filenames: archive.write(os.path.join(self.filepath, fn))